/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package service;

import beans.User;
import java.util.logging.Level;
import java.util.logging.Logger;
import jdbc.MyJdbc;

/**
 *
 * @author Administrator
 */
public class ChangeInfoService {

    public void ChangeInfo(User user) {
        String sql = "update student set passwords = ?,name = ?,major = ?,class = ?,telephone = ?,QQ = ?,email=?,"
                + "address = ? where id=" + user.getId();
        MyJdbc jdbc = new MyJdbc();
        jdbc.getConnection();
        try {
            jdbc.update(sql,user.getPasswords(),user.getName(),user.getMajor(),user.getClas(),user.getTelephone(),
                    user.getQQ(),user.getEmail(),user.getAdd());
            jdbc.close();
        } catch (Exception ex) {
            Logger.getLogger(ChangeInfoService.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
